/*
 * AgregarCine.java
 *
 * Created on 24-nov-2010, 11:34:36
 */

package IGU;

import datos.Cine;
import datos.ListaCine;
import datos.ListaTelefono;
import datos.Telefono;
import datos.Ubicacion;
import java.text.DateFormat;
import javax.swing.JFrame;
import logica.FuncionesGUI;

/**
 *
 * @author Cristian
 */
public class AgregarCine extends javax.swing.JFrame {

    private ListaTelefono listaTelefono = new ListaTelefono();

    public AgregarCine() {
        initComponents();
    }

    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jFrame1 = new javax.swing.JFrame();
        jLabel2 = new javax.swing.JLabel();
        jLabel1 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();
        jLabel6 = new javax.swing.JLabel();
        jLabel7 = new javax.swing.JLabel();
        jBAgregar = new javax.swing.JButton();
        jTNewCineID = new javax.swing.JTextField();
        JTNewCineDireccion = new javax.swing.JTextField();
        jTNewCineGerente = new javax.swing.JTextField();
        jLabel4 = new javax.swing.JLabel();
        jTHoraE = new javax.swing.JTextField();
        jTMinE = new javax.swing.JTextField();
        jTSegE = new javax.swing.JTextField();
        jLabel13 = new javax.swing.JLabel();
        jLabel14 = new javax.swing.JLabel();
        jLabel15 = new javax.swing.JLabel();
        jTelefonoNuevo = new javax.swing.JTextField();
        jBAgregarTelefono = new javax.swing.JButton();
        jTEmpleadoNuevo = new javax.swing.JTextField();
        jBAgregarEmpleado = new javax.swing.JButton();
        jPanel1 = new javax.swing.JPanel();
        jLabel12 = new javax.swing.JLabel();
        jLabel16 = new javax.swing.JLabel();
        jTHoraS = new javax.swing.JTextField();
        jTMinS = new javax.swing.JTextField();
        jTSegS = new javax.swing.JTextField();
        jLabel18 = new javax.swing.JLabel();
        jLabel17 = new javax.swing.JLabel();
        jLabel10 = new javax.swing.JLabel();
        jLabel11 = new javax.swing.JLabel();
        JTCiudad = new javax.swing.JTextField();
        JTDireccion = new javax.swing.JTextField();
        JTPais = new javax.swing.JTextField();
        jLPais = new javax.swing.JLabel();
        jLDireccion = new javax.swing.JLabel();
        jLCiudad = new javax.swing.JLabel();
        jLabel8 = new javax.swing.JLabel();

        jFrame1.setName("jFrame1"); // NOI18N

        javax.swing.GroupLayout jFrame1Layout = new javax.swing.GroupLayout(jFrame1.getContentPane());
        jFrame1.getContentPane().setLayout(jFrame1Layout);
        jFrame1Layout.setHorizontalGroup(
            jFrame1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 400, Short.MAX_VALUE)
        );
        jFrame1Layout.setVerticalGroup(
            jFrame1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 300, Short.MAX_VALUE)
        );

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        addWindowListener(new java.awt.event.WindowAdapter() {
            public void windowClosing(java.awt.event.WindowEvent evt) {
                formWindowClosing(evt);
            }
        });
        getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        jLabel2.setFont(new java.awt.Font("Tahoma", 1, 14));
        jLabel2.setForeground(new java.awt.Color(255, 255, 255));
        jLabel2.setText("Agregar Nuevo Cine");
        jLabel2.setName("jLabel2"); // NOI18N
        getContentPane().add(jLabel2, new org.netbeans.lib.awtextra.AbsoluteConstraints(232, 27, 150, -1));

        jLabel1.setForeground(new java.awt.Color(255, 255, 255));
        jLabel1.setText("ID:");
        jLabel1.setName("jLabel1"); // NOI18N
        getContentPane().add(jLabel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(45, 83, -1, -1));

        jLabel3.setForeground(new java.awt.Color(255, 255, 255));
        jLabel3.setText("Sucursal:");
        jLabel3.setName("jLabel3"); // NOI18N
        getContentPane().add(jLabel3, new org.netbeans.lib.awtextra.AbsoluteConstraints(45, 121, -1, -1));

        jLabel5.setForeground(new java.awt.Color(255, 255, 255));
        jLabel5.setText("Nuevo Telefono:");
        jLabel5.setName("jLabel5"); // NOI18N
        getContentPane().add(jLabel5, new org.netbeans.lib.awtextra.AbsoluteConstraints(42, 153, -1, -1));

        jLabel6.setForeground(new java.awt.Color(255, 255, 255));
        jLabel6.setText("Gerente:");
        jLabel6.setName("jLabel6"); // NOI18N
        getContentPane().add(jLabel6, new org.netbeans.lib.awtextra.AbsoluteConstraints(45, 196, -1, -1));

        jLabel7.setForeground(new java.awt.Color(255, 255, 255));
        jLabel7.setText("Empleados:");
        jLabel7.setName("jLabel7"); // NOI18N
        getContentPane().add(jLabel7, new org.netbeans.lib.awtextra.AbsoluteConstraints(45, 231, -1, -1));

        jBAgregar.setText("Agregar");
        jBAgregar.setName("jBAgregar"); // NOI18N
        jBAgregar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jBAgregarActionPerformed(evt);
            }
        });
        getContentPane().add(jBAgregar, new org.netbeans.lib.awtextra.AbsoluteConstraints(270, 502, -1, -1));

        jTNewCineID.setName("jTNewCineID"); // NOI18N
        jTNewCineID.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jTNewCineIDActionPerformed(evt);
            }
        });
        getContentPane().add(jTNewCineID, new org.netbeans.lib.awtextra.AbsoluteConstraints(145, 80, 170, -1));

        JTNewCineDireccion.setName("JTNewCineDireccion"); // NOI18N
        getContentPane().add(JTNewCineDireccion, new org.netbeans.lib.awtextra.AbsoluteConstraints(145, 118, 170, -1));

        jTNewCineGerente.setName("jTNewCineGerente"); // NOI18N
        getContentPane().add(jTNewCineGerente, new org.netbeans.lib.awtextra.AbsoluteConstraints(145, 186, 170, -1));

        jLabel4.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        jLabel4.setForeground(new java.awt.Color(255, 255, 255));
        jLabel4.setText("Horario de Entrada");
        jLabel4.setName("jLabel4"); // NOI18N
        getContentPane().add(jLabel4, new org.netbeans.lib.awtextra.AbsoluteConstraints(400, 80, -1, -1));

        jTHoraE.setName("jTHoraE"); // NOI18N
        getContentPane().add(jTHoraE, new org.netbeans.lib.awtextra.AbsoluteConstraints(460, 110, 105, -1));

        jTMinE.setName("jTMinE"); // NOI18N
        getContentPane().add(jTMinE, new org.netbeans.lib.awtextra.AbsoluteConstraints(460, 140, 105, -1));

        jTSegE.setName("jTSegE"); // NOI18N
        getContentPane().add(jTSegE, new org.netbeans.lib.awtextra.AbsoluteConstraints(460, 170, 105, -1));

        jLabel13.setForeground(new java.awt.Color(255, 255, 255));
        jLabel13.setText("Hora:");
        jLabel13.setName("jLabel13"); // NOI18N
        getContentPane().add(jLabel13, new org.netbeans.lib.awtextra.AbsoluteConstraints(410, 110, -1, -1));

        jLabel14.setForeground(new java.awt.Color(255, 255, 255));
        jLabel14.setText("Minuto:");
        jLabel14.setName("jLabel14"); // NOI18N
        getContentPane().add(jLabel14, new org.netbeans.lib.awtextra.AbsoluteConstraints(400, 140, -1, -1));

        jLabel15.setForeground(new java.awt.Color(255, 255, 255));
        jLabel15.setText("Segundo");
        jLabel15.setName("jLabel15"); // NOI18N
        getContentPane().add(jLabel15, new org.netbeans.lib.awtextra.AbsoluteConstraints(400, 170, -1, -1));

        jTelefonoNuevo.setName("jTelefonoNuevo"); // NOI18N
        jTelefonoNuevo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jTelefonoNuevoActionPerformed(evt);
            }
        });
        getContentPane().add(jTelefonoNuevo, new org.netbeans.lib.awtextra.AbsoluteConstraints(145, 150, 91, -1));

        jBAgregarTelefono.setText("Agregar");
        jBAgregarTelefono.setName("jBAgregarTelefono"); // NOI18N
        jBAgregarTelefono.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jBAgregarTelefonoActionPerformed(evt);
            }
        });
        getContentPane().add(jBAgregarTelefono, new org.netbeans.lib.awtextra.AbsoluteConstraints(241, 150, 84, -1));

        jTEmpleadoNuevo.setBackground(new java.awt.Color(204, 204, 204));
        jTEmpleadoNuevo.setName("jTEmpleadoNuevo"); // NOI18N
        getContentPane().add(jTEmpleadoNuevo, new org.netbeans.lib.awtextra.AbsoluteConstraints(144, 229, 96, -1));

        jBAgregarEmpleado.setText("Agregar");
        jBAgregarEmpleado.setName("jBAgregarEmpleado"); // NOI18N
        getContentPane().add(jBAgregarEmpleado, new org.netbeans.lib.awtextra.AbsoluteConstraints(246, 228, 80, -1));

        jPanel1.setBackground(new java.awt.Color(51, 51, 51));
        jPanel1.setName("jPanel1"); // NOI18N
        jPanel1.setLayout(null);

        jLabel12.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        jLabel12.setForeground(new java.awt.Color(255, 255, 255));
        jLabel12.setText("Horario de Salida");
        jLabel12.setName("jLabel12"); // NOI18N
        jPanel1.add(jLabel12);
        jLabel12.setBounds(410, 210, 110, 14);

        jLabel16.setForeground(new java.awt.Color(255, 255, 255));
        jLabel16.setText("Hora:");
        jLabel16.setName("jLabel16"); // NOI18N
        jPanel1.add(jLabel16);
        jLabel16.setBounds(420, 240, 27, 14);

        jTHoraS.setName("jTHoraS"); // NOI18N
        jPanel1.add(jTHoraS);
        jTHoraS.setBounds(460, 240, 111, 20);

        jTMinS.setName("jTMinS"); // NOI18N
        jPanel1.add(jTMinS);
        jTMinS.setBounds(460, 270, 111, 20);

        jTSegS.setName("jTSegS"); // NOI18N
        jPanel1.add(jTSegS);
        jTSegS.setBounds(460, 300, 111, 20);

        jLabel18.setForeground(new java.awt.Color(255, 255, 255));
        jLabel18.setText("Segundo");
        jLabel18.setName("jLabel18"); // NOI18N
        jPanel1.add(jLabel18);
        jLabel18.setBounds(400, 300, 42, 14);

        jLabel17.setForeground(new java.awt.Color(255, 255, 255));
        jLabel17.setText("Minuto:");
        jLabel17.setName("jLabel17"); // NOI18N
        jPanel1.add(jLabel17);
        jLabel17.setBounds(410, 270, 36, 14);

        jLabel10.setIcon(new javax.swing.ImageIcon(getClass().getResource("/IGU/imagen/imovie (2).png"))); // NOI18N
        jLabel10.setText("jLabel10");
        jLabel10.setName("jLabel10"); // NOI18N
        jPanel1.add(jLabel10);
        jLabel10.setBounds(380, 310, 230, 260);

        jLabel11.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        jLabel11.setForeground(new java.awt.Color(255, 255, 255));
        jLabel11.setText("Ubicacion Del Cine");
        jLabel11.setName("jLabel11"); // NOI18N
        jPanel1.add(jLabel11);
        jLabel11.setBounds(40, 310, 130, 28);

        JTCiudad.setName("JTCiudad"); // NOI18N
        jPanel1.add(JTCiudad);
        JTCiudad.setBounds(150, 350, 170, 20);

        JTDireccion.setName("JTDireccion"); // NOI18N
        jPanel1.add(JTDireccion);
        JTDireccion.setBounds(150, 380, 170, 20);

        JTPais.setName("JTPais"); // NOI18N
        jPanel1.add(JTPais);
        JTPais.setBounds(150, 410, 170, 20);

        jLPais.setForeground(new java.awt.Color(255, 255, 255));
        jLPais.setText("País:");
        jLPais.setName("jLPais"); // NOI18N
        jPanel1.add(jLPais);
        jLPais.setBounds(50, 420, 23, 14);

        jLDireccion.setForeground(new java.awt.Color(255, 255, 255));
        jLDireccion.setText("Dirección:");
        jLDireccion.setName("jLDireccion"); // NOI18N
        jPanel1.add(jLDireccion);
        jLDireccion.setBounds(50, 390, 47, 14);

        jLCiudad.setForeground(new java.awt.Color(255, 255, 255));
        jLCiudad.setText("Ciudad:");
        jLCiudad.setName("jLCiudad"); // NOI18N
        jPanel1.add(jLCiudad);
        jLCiudad.setBounds(50, 360, 37, 14);

        jLabel8.setIcon(new javax.swing.ImageIcon(getClass().getResource("/IGU/imagen/movies.png"))); // NOI18N
        jLabel8.setName("jLabel8"); // NOI18N
        jPanel1.add(jLabel8);
        jLabel8.setBounds(290, 370, 130, 150);

        getContentPane().add(jPanel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 0, 610, 550));

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jBAgregarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBAgregarActionPerformed


        System.out.println("ESTOS SON LOS TELEFONOS:\n");

        listaTelefono.imprimirColeccion();
         FuncionesGUI.cargarCineNuevo(listaTelefono, jTNewCineID,JTNewCineDireccion,jTNewCineGerente, JTCiudad,JTDireccion,JTPais,jTHoraE,jTMinE,jTSegE,jTHoraS,jTMinS,jTSegS);

        
         FuncionesGUI.habilitarVentana(this.ventanaPadre, true, true);
        this.dispose();

    }//GEN-LAST:event_jBAgregarActionPerformed

    private void jTNewCineIDActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTNewCineIDActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jTNewCineIDActionPerformed

    private void jTelefonoNuevoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTelefonoNuevoActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jTelefonoNuevoActionPerformed

    private void formWindowClosing(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowClosing
FuncionesGUI.habilitarVentana(this.ventanaPadre, true, true);
        this.dispose();
        // TODO add your handling code here:
    }//GEN-LAST:event_formWindowClosing

    private void jBAgregarTelefonoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBAgregarTelefonoActionPerformed
FuncionesGUI.agregarTelefonoNuevo(jTelefonoNuevo.getText(),listaTelefono);

jTelefonoNuevo.setText("");
        // TODO add your handling code here:
    }//GEN-LAST:event_jBAgregarTelefonoActionPerformed

    private void initMyOwnComponents()
    {
//        FuncionesBasicasGUI.inicializarCombo(jCBListaUsuarios, "Seleccione un usuario");
//        FuncionesBasicasGUI.cargarListaUsuariosEnCombo(jCBListaUsuarios, false);
    }
    
    private JFrame ventanaPadre;
        public JFrame getVentanaPadre()
    {
        return ventanaPadre;
    }
    public void setVentanaPadre(JFrame ventanaPadre)
    {
        this.ventanaPadre = ventanaPadre;
    }

     public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new AgregarCine().setVisible(true);
            }
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JTextField JTCiudad;
    private javax.swing.JTextField JTDireccion;
    private javax.swing.JTextField JTNewCineDireccion;
    private javax.swing.JTextField JTPais;
    private javax.swing.JButton jBAgregar;
    private javax.swing.JButton jBAgregarEmpleado;
    private javax.swing.JButton jBAgregarTelefono;
    private javax.swing.JFrame jFrame1;
    private javax.swing.JLabel jLCiudad;
    private javax.swing.JLabel jLDireccion;
    private javax.swing.JLabel jLPais;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel jLabel14;
    private javax.swing.JLabel jLabel15;
    private javax.swing.JLabel jLabel16;
    private javax.swing.JLabel jLabel17;
    private javax.swing.JLabel jLabel18;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JTextField jTEmpleadoNuevo;
    private javax.swing.JTextField jTHoraE;
    private javax.swing.JTextField jTHoraS;
    private javax.swing.JTextField jTMinE;
    private javax.swing.JTextField jTMinS;
    private javax.swing.JTextField jTNewCineGerente;
    private javax.swing.JTextField jTNewCineID;
    private javax.swing.JTextField jTSegE;
    private javax.swing.JTextField jTSegS;
    private javax.swing.JTextField jTelefonoNuevo;
    // End of variables declaration//GEN-END:variables

}
